package com.xuanwei.search.entity.index;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;

/**
 * @Author jiangyong
 * @Description TODO
 * @Date 2019/6/27 18:24
 **/
@Data
public class ProductAttribute {
    @Field(type = FieldType.Long)
    private Integer id;
    /**
     * 名称
     */
    @Field(type = FieldType.Keyword)
    private String name;
    /**
     * 值
     */
    @Field(type = FieldType.Object)
    private List<AttributeValue> values;


    public static class AttributeValue{
        @Field(type = FieldType.Integer)
        private Integer id;
        /**
         * 名称
         */
        @Field(type = FieldType.Keyword)
        private String name;
        /**
         * 图
         */
        @Field(type = FieldType.Keyword)
        private String image;

        public String getImage() {
            return image;
        }

        public void setImage(String image) {
            this.image = image;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
